


ac.sync:event '同步-吞噬技能'(function(_,player,index)
    local list = player:get_data('技能吞噬列表') or {}
    local hero = player.hero
    local skill = hero and hero:find_skill(index,'英雄')
    local open = player:get_data('吞噬技能')
    player:set_data('吞噬技能',nil)
    if open and skill then
        show_skill_tip(player,skill,'吞噬')
        skill:remove()
        skill:remove_ability()
        table.insert(list,skill)
        player:set_data('技能吞噬列表',list)
    end
end)


ac.item('英雄吞噬丹'){
    item_type = "charged",
    auto_merge = true,
    count = 1,
    cool = 0.2,
    food = 4888,
    model = [[wp_yxtsd.mdl]],
    tip = [[吞噬英雄天赋，获得该天赋]],
    on_use = function(self, item)
        local unit = self.owner
        local player = unit.owner
        local hero = player.hero
        local index = 0
        for a=1,7 do
            local temp = hero:find_skill(a,'英雄')
            if temp then
                index = index + 1
            end
        end
        if index>0 then
            player:notify('玩家-显示吞噬技能',player)
        else
            self:set_count(self:get_count())
            ac.console:error(player, "没有技能可以吞噬")
            return
        end

    end
}